-- GENERATED SPELL FOR [Shadowforge Senator] --


function spell0_8904(pUnit, Event) --@Curse of Agony,n/a--
pUnit:FullCastSpellOnTarget(14868,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8904', 30000, 1)
end

function spell1_8904(pUnit, Event) --@Fire Shield III,n/a--
pUnit:FullCastSpellOnTarget(2601,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8904', 31000, 1)
end

function spell2_8904(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(14034,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8904', 3000, 1)
end

function spell3_8904(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(11831,pUnit)
pUnit:RegisterEvent('Sorts_8904', 8349, 1)
end

function spell4_8904(pUnit, Event) --@Holy Smite,n/a--
pUnit:FullCastSpellOnTarget(15498,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8904', 2500, 1)
end

function spell5_8904(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(12471,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8904', 3000, 1)
end

function spell6_8904(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(15547,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8904', 602, 1)
end

function spell7_8904(pUnit, Event) --@Slow,n/a--
pUnit:FullCastSpellOnTarget(11436,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8904', 10000, 1)
end

function Sorts_8904(pUnit, Event)
local choix_sorts_8904 = math.random(0, 7)
if choix_sorts_8904 == 0 then
pUnit:RegisterEvent('spell0_8904', 1, 1)
end
if choix_sorts_8904 == 1 then
pUnit:RegisterEvent('spell1_8904', 1, 1)
end
if choix_sorts_8904 == 2 then
pUnit:RegisterEvent('spell2_8904', 1, 1)
end
if choix_sorts_8904 == 3 then
pUnit:RegisterEvent('spell3_8904', 1, 1)
end
if choix_sorts_8904 == 4 then
pUnit:RegisterEvent('spell4_8904', 1, 1)
end
if choix_sorts_8904 == 5 then
pUnit:RegisterEvent('spell5_8904', 1, 1)
end
if choix_sorts_8904 == 6 then
pUnit:RegisterEvent('spell6_8904', 1, 1)
end
if choix_sorts_8904 == 7 then
pUnit:RegisterEvent('spell7_8904', 1, 1)
end
end

function mob8904_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_8904', math.random(1500, 3000), 1)
end

function mob8904_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob8904_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob8904_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(8904, 1, 'mob8904_Action')
RegisterUnitEvent(8904, 2, 'mob8904_Leave')
RegisterUnitEvent(8904, 3, 'mob8904_Kill')
RegisterUnitEvent(8904, 4, 'mob8904_Die')
